package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.WorkspaceService;
import com.sky.vo.BusinessDataVO;
import com.sky.vo.DishOverViewVO;
import com.sky.vo.OrderOverViewVO;
import com.sky.vo.SetmealOverViewVO;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * packageName com.sky.controller.admin
 *
 * @author fenglai
 * @version JDK 11
 * @className WorkspaceController
 * @date 2023/12/8
 * @description TODO
 */


@RestController
@RequestMapping("/admin/workspace")
@Slf4j
public class WorkspaceController {
    @Autowired
    private WorkspaceService workspaceService;

    /**
     * @param : return Result<BusinessDataVO>
     * @author fenglai
     * @date 2023/12/8 15:37
     * @description 查询今日的运营数据功能
     */
    @ApiOperation("查询今日的运营数据")
    @GetMapping("/businessData")
    public Result<BusinessDataVO> businessData() {

        log.info("正在执行查询今日的运营数据的功能........");

        BusinessDataVO businessDataVO = workspaceService.getBusinessData();

        return Result.success(businessDataVO);
    }

    /**
     * @param : return Result<SetmealOverViewVO>
     * @author fenglai
     * @date 2023/12/8 15:58
     * @description 查询套餐总览功能
     */
    @ApiOperation("查询套餐总览的功能")
    @GetMapping("/overviewSetmeals")
    public Result<SetmealOverViewVO> overviewSetmeals() {

        log.info("正在执行查询套餐总览的功能...............");

        SetmealOverViewVO setmealOverViewVO = workspaceService.overviewSetmeals();

        return Result.success(setmealOverViewVO);
    }

    /**
     * @param : return Result<DishOverViewVO>
     * @author fenglai
     * @date 2023/12/8 16:03
     * @description 查询菜品总览的功能
     */

    @ApiOperation("查询菜品总览的功能")
    @GetMapping("/overviewDishes")
    public Result<DishOverViewVO> overviewDishes() {

        log.info("正在执行查询菜品总览的功能.................");


        DishOverViewVO dishOverViewVO = workspaceService.overviewDishes();

        return Result.success(dishOverViewVO);
    }

    /**
     * @param :
     * return Result<OrderOverViewVO>
     * @author fenglai
     * @date 2023/12/8 16:10
     * @description 查询订单管理数据功能
     */
    @ApiOperation("查询订单管理数据功能")
    @GetMapping("/overviewOrders")
    public Result<OrderOverViewVO> overviewOrders() {

        log.info("正在执行查询订单管理数据的功能...............");

        OrderOverViewVO orderOverViewVO = workspaceService.overviewOrders();

        return  Result.success(orderOverViewVO);
    }

}